<%--
  Created by IntelliJ IDEA.
  User: 23732
  Date: 2018/3/7
  Time: 15:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>个人信息测试页面</title>
</head>
<body>
<table>
    <select id="parent" onchange="clickpt()">
        <option>
            <c:forEach items="${sessionScope.AllUser}" var="allUser">
            <tr>
        <option value="${allUser.u_id}">${allUser.d_name}</option>
        </tr>
    </select>
        </c:forEach>
        <select id="child" onchange="clickpt">
            <option>
                <c:forEach items="${sessionScope.AllUser}" var="allUser">
                <tr>
            <option value="${allUser.u_id}">${allUser.name}</option>
            </tr>
            </c:forEach>
        </option>
    </select>
</table>
</body>
<script type="text/javascript">
    function clickpt() {
        var parent  =document.getElementById("parent");
        var p = parent.value;
        var child = document.getElementById("child");
        var c = child.options.length;
        if(c>0){
            for(var i=0;i<c;i++){
                child.options.remove(0);
            }
        }
        if(p = "1"){


        }
    }
</script>
</html>
